package com.example.thecharacterbook;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;

public class TheAddMethod extends AppCompatActivity {
    private EditText word,mean,example,example2,example3;
    private Button button;
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_the_add_method);
        word=findViewById(R.id.word);
        mean=findViewById(R.id.mean);
        example=findViewById(R.id.example);
        example2=findViewById(R.id.example2);
        example3=findViewById(R.id.example3);
        button=findViewById(R.id.AddBtn);
        button.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {
                MyDataBase db = new MyDataBase(TheAddMethod.this);
                db.addWord(word.getText().toString().trim(),
                        mean.getText().toString().trim(),
                        example.getText().toString().trim(),example2.getText().toString().trim(),example3.getText().toString().trim()
                );
            }
        });
    }
}